package psn.zjk.common.jdk;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Description
 * @User zero
 * @Datetime 2021/5/31 19:23
 */
public class LRUImpl extends LinkedHashMap {


    @Override
    protected boolean removeEldestEntry(Map.Entry eldest) {
        return super.removeEldestEntry(eldest);
    }

    public static void main(String[] args) {
        LinkedHashMap<Object, Object> objectObjectLinkedHashMap = new LinkedHashMap<>();
        objectObjectLinkedHashMap.put("a","x");
        objectObjectLinkedHashMap.put("a","x1");
        System.out.println(objectObjectLinkedHashMap.get("a"));
        System.out.println(objectObjectLinkedHashMap.get("a"));
    }
}
